﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 继承_中_01雇员
{

     //雇员系统，定义雇员基类，共同的属性，姓名、地址和出生日期(可有可无)，
     //子类：程序员，秘书，高层管理，清洁工，他们有不同的工资算法，
     //其中高级主管和程序员采用底薪加提成的方式，高级主管和程序员的底薪分别是5000元和2000元 ，
    class Work
    {
        public string name { get; set; }
        public string address { get; set; }
        public string date { get; set; }

        public Work(string name,string address, string date) 
        {
            this.date = date;
            this.address = address;
            this.name = name;
        }
        public void outs()
        {
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}",name,address,date);
        }
    }

     class Programmer : Work
    {
        private int pushmoney;
        private int money;
        public int Pushmoney { get => pushmoney; set => pushmoney = value; }
        public int Money { get => money; set => money = value; }

        public Programmer( int pushmoney,int money, string name, string address, string date):base(name,address,date)
        {
            this.pushmoney = pushmoney;
            this.money = money; 
        }
        public void Pouts() 
        {
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n底薪:{3}\n提成:{4}", name, address, date,pushmoney,money);
        }
    }
    //秘书和清洁工采用工资的方式，工资分别是3000和1000，
    class secretary : Work 
    {
        private int wages;

        public int Wages { get => wages; set => wages = value; }
        public secretary (string name, string address, string date, int wages):base(name,address,date)
        {
            this.wages = wages;
        }
        public void Souts()
        {
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n工资:{3}", name, address, date, wages);
        }
    }
}
